home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Unbuffered character input...
- Date: Mon, 12 Feb 96 16:02:26 GMT
- Organization: none
- Message-ID: <824140946snz@genesis.demon.co.uk>
- References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <9602022043.AA13287@dxmint.cern.ch> <4f7hlf$87n@airdmhor.gen.nz> <9602061701.AA21789@dxmint.cern.ch> <4f8kat$ofv@solutions.solon.com> <823794347snz@genesis.demon.co.uk> <danpop.823811815@rscernix>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <danpop.823811815@rscernix> danpop@mail.cern.ch "Dan Pop" writes:
-
- >In <823794347snz@genesis.demon.co.uk> Lawrence Kirby <fred@genesis.demon.co.uk>
- > writes:
- >
- >>In article <4f8kat$ofv@solutions.solon.com>
- >> seebs@solutions.solon.com "Peter Seebach" writes:
- >>
- >>>In article <9602061701.AA21789@dxmint.cern.ch>,
- >>>Dan Pop <danpop@mail.cern.ch> wrote:
- >>>>But even on systems where it is not, it still saves processor time.
- >>>>The cpu overhead of making a single OS call to get a complete line of input
- >>>>is smaller (sometimes significantly smaller) than the overhead of making
- >>>>N OS calls, one for each character of the line. The stdio library tries
- >>>>to do its best to minimize the number of (expensive) OS calls.
- >>
- >>The stdio library typically reads characters as soon as they are available
- >>so it does very little in this respect except provide suitable buffering
- >>when more than one character happens to be available on a read. This is
- >>clearly significant for file I/O but whether terminal I/O makes user typed
- >>characters immediately available or not is usually purely a function of the
- >>OS. Setting line buffering on input streams on many/most stdio libraries
- >>doesn't do anything special.
- >
- >Because the line buffering is performed by the tty driver. The tty driver
- >won't (unless explicitly asked) make characters available as soon as they
- >are typed and the stdio library doesn't attempt to get them as soon as
- >they're typed. It looks like line buffered terminal input to me, unless
- >I'm missing something.
-
- (Much quoting but this is all rather context-sensitive)
-
- Agreed. My point was simply to stress that in this case this is not a
- function of stdio, rather it is a function of the tty driver.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-